#include "app.h"
#include "BUTTON/mbutton.h"
#include "MultiButton/multi_button.h"

void vApplicationTickHook( void )
{
    /* This function will be called by each tick interrupt if
    configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h. User code can be
    added here, but the tick hook is called from an interrupt context, so
    code must not attempt to block, and only the interrupt safe FreeRTOS API
    functions can be used (those that end in FromISR()). */
    lv_tick_inc(1);
}

// 界面事件处理
void page_event_handle(void)
{
    mbutton_data_t mbutton_data;
    if (xQueueReceive(xButtonDataQueue, &mbutton_data, 0) == pdTRUE) 
    {
        if(mbutton_data.id == KEY1 && mbutton_data.event == SINGLE_CLICK)
            page_event_transmit(NULL, PAGE_EVENT_KEY1_SC);
    }   
}

void lvgl_task(void *arg){
    display_init();
    while(1)
    {
        display_update();
        page_event_handle();
        vTaskDelay(1);
    }
}









